package com.bestescortbedsystem.util;

import java.io.File;
import java.io.FileOutputStream;

/**
 * ClassName: FileUtil
 * Package: com.bestescortbedsystem.util
 *
 * @author: guanzepeng
 * @Date: 2021/2/24 16:13 星期三
 * @Description: 上传文件工具类
 */
public class FileUtil {

	/**
	 * 进行文件上传
	 * @param file
	 * @param filePath
	 * @param fileName
	 * @throws Exception
	 */
		public static void uploadFile(byte[] file, String filePath, String fileName) throws Exception {
			File targetFile = new File(filePath);
			if(!targetFile.exists()){
				targetFile.mkdirs();
			}
			FileOutputStream out = new FileOutputStream(filePath+fileName);
			out.write(file);
			out.flush();
			out.close();
		}
}

